#!/usr/bin/python3
#coding=utf-8

import grpc
from example import data_pb2, data_pb2_grpc

_HOST = 'localhost'
_PORT = '8080'

def run():
    conn = grpc.insecure_channel(_HOST + ':' + _PORT)
    
    # client = data_pb2_grpc.FormatDataStub(channel=conn)
    # response = client.DoFormat(data_pb2.DataFrom(text='hello,world! asdfaieuflsd'))
    # print("received: " + response.text)

    client = data_pb2_grpc.DemoLearnStub(channel=conn)
    response = client.DemoSearch(data_pb2.OrderReq(skuNo='25974876116355840-3'))
    print("received: " + response.orderNumber)
if __name__ == '__main__':
    run()